package com.isoft.entity;

import jakarta.xml.bind.annotation.*;
import lombok.Data;

@Data
@XmlRootElement(name = "MSG")
@XmlAccessorType(XmlAccessType.FIELD)
public class DfmeCfleEntity {
    @XmlElement(name = "META")
    private Meta meta;

    @XmlElement(name = "CRFT")
    private Crft crft;

    // 用于接收AIRCRAFT表的自增ID
    private Long aircraftId;

    @Data
    @XmlAccessorType(XmlAccessType.FIELD)
    public static class Meta {
        @XmlElement(name = "sndr")
        private String sender;
        @XmlElement(name = "rcvr")
        private String receiver;
        @XmlElement(name = "seqn")
        private Long sequenceNumber;
        @XmlElement(name = "ddtm")
        private String dateTime;
        @XmlElement(name = "type")
        private String type;
        @XmlElement(name = "styp")
        private String subType;
        // 用于接收MSG_META表的自增ID
        private Long msgId;

        public Long getMsgId() {
            return msgId;
        }

        public void setMsgId(Long msgId) {
            this.msgId = msgId;
        }
    }

    @Data
    @XmlAccessorType(XmlAccessType.FIELD)
    public static class Crft {
        @XmlElement(name = "code")
        private String aircraftCode;
        @XmlElement(name = "cftp")
        private String aircraftType;
        @XmlElement(name = "awcd")
        private String airlineCode;
        @XmlElement(name = "stnm")
        private String stationNumber;
        @XmlElement(name = "rstn")
        private String remoteStation;
        @XmlElement(name = "cfsa")
        private String aircraftStatus;
        @XmlElement(name = "ttwc")
        private String totalWeight;
        @XmlElement(name = "mxlw")
        private String maxLandingWeight;
        @XmlElement(name = "rllw")
        private String rollingWeight;
        private Long aircraftId;
        private String code;

        public Long getAircraftId() {
            return aircraftId;
        }

        public void setAircraftId(Long aircraftId) {
            this.aircraftId = aircraftId;
        }

        public String getAircraftCode() {
            return aircraftCode;
        }

        public void setAircraftCode(String aircraftCode) {
            this.aircraftCode = aircraftCode;
        }

        public String getCode() {
            return code;
        }

        public void setCode(String code) {
            this.code = code;
        }
    }

    public Meta getMeta() {
        return meta;
    }

    public void setMeta(Meta meta) {
        this.meta = meta;
    }

    public Crft getCrft() {
        return crft;
    }

    public void setCrft(Crft crft) {
        this.crft = crft;
    }
}